#ifndef __UPDATE_H_
#define __UPDATE_H_
#include "stdint.h"
enum
{
	WAIT_FOR_UPDATE  = 0X00,
	NEED_JUMP_TO_APP = 0X01,
};
typedef enum
{
	ACTION_NONE = 0X00,
	ACTION_JUMPTOAPP,
	ACTION_WAIT_FOR_UPDATE,
}ACTION_t;
typedef struct
{
	uint32_t file_size;
	uint16_t file_crc;	
	uint16_t update_index;
	uint8_t  total_sectors;
	uint16_t total_package;
	uint16_t one_package_size; 
	uint8_t file_receive_finish;
	uint8_t file_read_finish_R;	
	uint8_t update_result;
} UPDATEFILE_t;
extern UPDATEFILE_t update_app;

extern uint8_t receive_data[512];
void init_updatefile(void);
void Send_Read_Flash_App_Result(void);
ACTION_t power_button_check(void);
#endif
